<app-back-btn></app-back-btn>
<div class="page-title">
  <span class="title" *ngIf="!code">添加新闻公告</span>
  <span class="title" *ngIf="code">修改新闻公告</span>
</div>

<div class="panel panel-body">
  <form nz-form [formGroup]="validateForm" class="form-wrap" (submit)="addNews($event)">
    <h2 class="subtitle">公告信息</h2>

    <!--title start-->
    <nz-form-item>
      <nz-form-label [nzSm]="5" nzFor="title" nzRequired>公告标题</nz-form-label>
      <nz-form-control [nzSm]="12" [nzValidateStatus]="getFormControl('title')">
        <input nz-input formControlName="title" type="text" id="title" placeholder="公告标题 64个汉字">
        <nz-form-explain *ngIf="getFormControl('title').dirty&&getFormControl('title').errors">
          <ng-container *ngIf="getFormControl('title').hasError('required')">请输入公告标题</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        公告标题 最长64个汉字
      </nz-form-control>
    </nz-form-item>

    <!--summary start-->
    <nz-form-item>
      <nz-form-label [nzSm]="5" nzFor="content" nzRequired>摘要</nz-form-label>
      <nz-form-control [nzSm]="12" [nzValidateStatus]="getFormControl('content')">
        <ckeditor formControlName="content" id="content"></ckeditor>
        <nz-form-explain *ngIf="getFormControl('content').dirty&&getFormControl('content').errors">
          <ng-container *ngIf="getFormControl('content').hasError('required')">请输入摘要</ng-container>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <!--表单底部start-->
    <nz-form-item class="action-button">
      <nz-form-control class="text-center">
        <button nz-button [nzType]="'primary'" type="submit" class="pl-30 pr-30"
                [nzLoading]="isConfirmLoading">
          确定
        </button>
      </nz-form-control>
    </nz-form-item>
    <!--表单底部end-->
  </form>

</div>
